# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Content.V21.Model.WarehouseBasedDeliveryTime do
  @moduledoc """


  ## Attributes

  *   `carrier` (*type:* `String.t`, *default:* `nil`) - Required. Carrier, such as `"UPS"` or `"Fedex"`. The list of supported carriers can be retrieved through the `listSupportedCarriers` method.
  *   `carrierService` (*type:* `String.t`, *default:* `nil`) - Required. Carrier service, such as `"ground"` or `"2 days"`. The list of supported services for a carrier can be retrieved through the `listSupportedCarriers` method. The name of the service must be in the eddSupportedServices list.
  *   `originAdministrativeArea` (*type:* `String.t`, *default:* `nil`) - Shipping origin's state.
  *   `originCity` (*type:* `String.t`, *default:* `nil`) - Shipping origin's city.
  *   `originCountry` (*type:* `String.t`, *default:* `nil`) - Shipping origin's country represented as a [CLDR territory code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
  *   `originPostalCode` (*type:* `String.t`, *default:* `nil`) - Shipping origin.
  *   `originStreetAddress` (*type:* `String.t`, *default:* `nil`) - Shipping origin's street address.
  *   `warehouseName` (*type:* `String.t`, *default:* `nil`) - The name of the warehouse. Warehouse name need to be matched with name. If warehouseName is set, the below fields will be ignored. The warehouse info will be read from warehouse.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :carrier => String.t() | nil,
          :carrierService => String.t() | nil,
          :originAdministrativeArea => String.t() | nil,
          :originCity => String.t() | nil,
          :originCountry => String.t() | nil,
          :originPostalCode => String.t() | nil,
          :originStreetAddress => String.t() | nil,
          :warehouseName => String.t() | nil
        }

  field(:carrier)
  field(:carrierService)
  field(:originAdministrativeArea)
  field(:originCity)
  field(:originCountry)
  field(:originPostalCode)
  field(:originStreetAddress)
  field(:warehouseName)
end

defimpl Poison.Decoder, for: GoogleApi.Content.V21.Model.WarehouseBasedDeliveryTime do
  def decode(value, options) do
    GoogleApi.Content.V21.Model.WarehouseBasedDeliveryTime.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Content.V21.Model.WarehouseBasedDeliveryTime do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
